import { defineStore, createPinia } from "pinia";
const pinia = createPinia(); // 创建一个 Pinia 实例
pinia.use(piniaPluginPersistedstate); // 使用 pinia-plugin-persistedstate 插件
export const useStore = defineStore("userStore", {
  //其他配置项
  state: () => {
    return {
      userInfo: {},
      token: "",
    };
  },
  getters: {
    getUserInfo: (state) => {
      return state.userInfo;
    },
  },
  actions: {
    getUserInfo: () => {
      return this.userInfo;
    },
  },
  persist: true,
});

export default pinia;
